package fr.upvm.lem3.vm3d.ui.swing.util;

/**
 * final class used to get the Operating System on which the program are launching on
 *******************************************************************
 *OSOutils.java
 *13.02.2012
 *@author Guy Nougouapi
 *******************************************************************
 *
 *******************************************************************
 */
public  final  class OsUtils{
	
   private static String OS = null;  // variable used to store the name of the OS
   
   /**
    * 
    * @return the name of the OS
    */
   public static String getOsName(){
	   	if(OS == null) { 
	   		OS = System.getProperty("os.name"); 
	   	}
	   	return OS;
   }
   
   /*
    * check if it#s a Windows system
    */
   public static boolean isWindows(){
      return getOsName().startsWith("Windows");
   }
   
   /**
    * check if it's a UNIX or LINUX System
    */
   public static boolean isUnixLinux(){
	   return ( getOsName().startsWith("Unix") || getOsName().startsWith("Linux"));
   }
	
}
